<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>isAfterDate</title>
</head>

<body>
    <div>打开浏览器控制台查看结果</div>
    <script>
        const isAfterDate = (dateA, dateB) => {
            if (dateA instanceof Date && dateB instanceof Date) {
                return dateA > dateB;
            }
            return false;
        };
        console.log(isAfterDate(new Date(2010, 10, 21), new Date(2010, 10, 20)));
    </script>
</body>

</html>